package com.zzyl.serve.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "家属服务项")
@RestController
@RequestMapping("/member/orders")
public class MemberOrderController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 分页查询护理项目列表
     */
    @GetMapping("/project/page")
    @ApiOperation(value = "分页查询护理项目列表", notes = "分页查询护理项目列表")
    public TableDataInfo list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    /**
     * 根据编号查询护理项目信息
     */
    @GetMapping("/project/{id}")
    @ApiOperation(value = "根据编号查询护理项目信息", notes = "根据编号查询护理项目信息")
    public AjaxResult getInfo(@PathVariable Integer id)
    {
        return success(nursingProjectService.selectNursingProjectById(id));
    }
}